#include "YGDevice.h"

#if (YG_OS_TYPE == YG_OS_TYPE_WINDOWSMOBILE)

	#include "WM6/YGDeviceWM6.h"

#elif (YG_OS_TYPE == YG_OS_TYPE_ANDROID)

	#include "Android/YGDeviceAndroid.h"

#endif

namespace YoghurtGum
{

	Device* Device::s_Instance = NULL;

	void Device::SetInstance(Device* a_Instance)
	{
		s_Instance = a_Instance;
		Log::SetInstance(s_Instance->GetLogInstance());
		FileManager::SetInstance(s_Instance->GetFileManagerInstance());
	}

	Log* Device::GetLogInstance()
	{
		return m_Log;
	}

	FileManager* Device::GetFileManagerInstance()
	{
		return m_FileManager;
	}

#if (YG_OS_TYPE == YG_OS_TYPE_WINDOWSMOBILE)

	Device& Device::Get()
	{
		if (!s_Instance) { s_Instance = new DeviceWM6(); }
		return *s_Instance;
	}

#elif (YG_OS_TYPE == YG_OS_TYPE_ANDROID)

	Device& Device::Get()
	{
		if (!s_Instance) { s_Instance = new DeviceAndroid(); }
		return *s_Instance;
	}

#endif

	Device::Device()
	{
		m_Log = &Log::GetSingleton();
		m_FileManager = &FileManager::Get();
	}

	Device::~Device()
	{

	}

}; // namespace YoghurtGum
